/* UC系统Inter字体系统 */

/* ===== Inter字体导入 ===== */
/* 临时禁用Google字体，使用系统字体回退 */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); */

/* 字体加载策略：优先使用系统字体，避免网络加载失败 */
/*
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Inter Regular'), local('Inter-Regular'), url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('Inter Medium'), local('Inter-Medium'), url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('Inter SemiBold'), local('Inter-SemiBold'), url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGK4AZ9hiA.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Inter Bold'), local('Inter-Bold'), url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYZ9hiA.woff2') format('woff2');
}
*/

/* ===== 字体变量定义 ===== */
:root {
  --font-family-inter: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Consolas', 'Courier New', monospace;

  /* 字体权重 */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* 行高 */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* 字母间距 */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
}

/* ===== 全局字体基础设置 ===== */
:root {
  --uc-font-family: var(--font-family-inter);
  --uc-font-family-mono: var(--font-family-mono);
}

/* ===== 数字稳定显示 (tabular-nums) ===== */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* 数字专用样式 */
.numeric-text,
.price-text,
.score-text,
.time-text,
.date-text,
.percentage-text {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
}

/* ===== 全局字体系统应用 ===== */
* {
  font-family: inherit;
}

html,
body {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== 标题字体系统 ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin: 0;
}

h1 {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
}

/* ===== 正文字体系统 ===== */
p {
  font-family: var(--uc-font-family);
  font-size: 1rem;
  line-height: var(--line-height-normal);
  margin: 0;
  color: var(--uc-text-primary);
}

/* ===== 小字体系统 ===== */
.small-text {
  font-size: 0.875rem;
  line-height: var(--line-height-normal);
}

.tiny-text {
  font-size: 0.75rem;
  line-height: var(--line-height-normal);
}

/* ===== 特殊文本样式 ===== */
.text-semibold {
  font-weight: var(--font-weight-semibold);
}

.text-medium {
  font-weight: var(--font-weight-medium);
}

.text-bold {
  font-weight: var(--font-weight-bold);
}

.text-tight {
  letter-spacing: var(--letter-spacing-tight);
}

.text-wide {
  letter-spacing: var(--letter-spacing-wide);
}

/* ===== 表单元素字体 ===== */
input,
textarea,
select {
  font-family: var(--uc-font-family);
  font-size: 0.875rem;
  line-height: var(--line-height-normal);
}

button {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-tight);
}

/* ===== 代码字体 ===== */
code {
  font-family: var(--uc-font-family-mono);
  font-size: 0.875em;
  background-color: var(--uc-bg-tertiary);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

pre {
  font-family: var(--uc-font-family-mono);
  font-size: 0.875rem;
  line-height: var(--line-height-relaxed);
  background-color: var(--uc-bg-tertiary);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
}

/* ===== 数字显示组件 ===== */
.numeric-display {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
  font-weight: var(--font-weight-medium);
}

/* 评分显示 */
.score-display {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
  font-weight: var(--font-weight-semibold);
  font-size: 1.125rem;
}

/* 置信度百分比 */
.confidence-percentage {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
  font-weight: var(--font-weight-medium);
  font-size: 0.875rem;
}

/* 时间显示 */
.time-display {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
  font-weight: var(--font-weight-normal);
  font-size: 0.875rem;
  color: var(--uc-text-secondary);
}

/* 日期显示 */
.date-display {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
  font-weight: var(--font-weight-normal);
  font-size: 0.875rem;
  color: var(--uc-text-secondary);
}

/* 价格显示 */
.price-display {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
  font-weight: var(--font-weight-medium);
  font-size: 1rem;
}

/* 医疗数值显示 */
.medical-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--font-family-inter);
  font-weight: var(--font-weight-semibold);
  font-size: 1.125rem;
  color: var(--uc-text-primary);
}

.medical-unit {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-normal);
  font-size: 0.875rem;
  color: var(--uc-text-secondary);
  margin-left: 0.25rem;
}

/* ===== Element Plus 字体覆盖 ===== */
.el-button {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-tight);
}

.el-input__inner {
  font-family: var(--uc-font-family);
  font-size: 0.875rem;
}

.el-select__input {
  font-family: var(--uc-font-family);
  font-size: 0.875rem;
}

.el-textarea__inner {
  font-family: var(--uc-font-family);
  font-size: 0.875rem;
  line-height: var(--line-height-normal);
}

.el-form-item__label {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-medium);
  font-size: 0.875rem;
}

.el-table {
  font-family: var(--uc-font-family);
  font-size: 0.875rem;
}

.el-table th {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-semibold);
}

.el-menu-item {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-tight);
}

.el-card__header {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-semibold);
}

.el-dialog__title {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-semibold);
}

.el-message {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-medium);
}

.el-notification__title {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-semibold);
}

.el-notification__content {
  font-family: var(--uc-font-family);
  font-weight: var(--font-weight-normal);
}

/* ===== 响应式字体缩放 ===== */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.375rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4 {
    font-size: 1.125rem;
  }

  .medical-value {
    font-size: 1rem;
  }

  .score-display {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.125rem;
  }

  h3 {
    font-size: 1rem;
  }

  .medical-value {
    font-size: 0.875rem;
  }

  .score-display {
    font-size: 0.875rem;
  }
}

/* ===== 特殊情况字体回退 ===== */
@supports not (font-variant-numeric: tabular-nums) {
  .tabular-nums,
  .numeric-text,
  .price-text,
  .score-text,
  .time-text,
  .date-text,
  .percentage-text {
    font-family: var(--font-family-mono);
  }
}

/* ===== 打印字体优化 ===== */
@media print {
  * {
    font-family: 'Times New Roman', serif !important;
  }

  .tabular-nums,
  .numeric-text,
  .price-text,
  .score-text,
  .time-text,
  .date-text,
  .percentage-text {
    font-family: 'Courier New', monospace !important;
  }
}

/* ===== 高对比度模式字体 ===== */
@media (prefers-contrast: high) {
  * {
    font-weight: var(--font-weight-medium);
  }

  .text-bold {
    font-weight: var(--font-weight-bold);
  }
}

/* ===== 减少动画偏好模式 ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}